package lanou3g.myfirstapp36kr.fragment;

import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.Toast;

import lanou3g.myfirstapp36kr.activity.AccountMessageActivity;
import lanou3g.myfirstapp36kr.activity.ColectionActivity;
import lanou3g.myfirstapp36kr.activity.MoneyQuickActivity;
import lanou3g.myfirstapp36kr.activity.MyMoneyActivity;
import lanou3g.myfirstapp36kr.activity.MyMoneyCompanyActivity;
import lanou3g.myfirstapp36kr.activity.MyOrderActivity;
import lanou3g.myfirstapp36kr.R;
import lanou3g.myfirstapp36kr.activity.SettingActivity;
import lanou3g.myfirstapp36kr.base.BaseFragment;
import lanou3g.myfirstapp36kr.srcollView.CircleDrawable;

/**
 * Created by dllo on 16/8/2.
 */
public class MyFragment extends BaseFragment {
    private ImageView imageViewSetting;
    private FrameLayout frameLayout;
    private ImageView imageViewqq;
    @Override
    protected int getLayout() {
        return R.layout.fragment_my;
    }

    @Override
    protected void initView(View view) {
        imageViewqq = (ImageView) view.findViewById(R.id.iv_qq);
        frameLayout = (FrameLayout) view.findViewById(R.id.frame_layout_tell);

        imageViewSetting = (ImageView) view.findViewById(R.id.iv_fragmentmy_setting);
        imageViewSetting.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(), SettingActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.know_money).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(),MoneyQuickActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.my_colection).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(), ColectionActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.my_order).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(), MyOrderActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.account_message).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(), AccountMessageActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.money_sure).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(),MoneyQuickActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.my_money_company).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(),MyMoneyCompanyActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.my_money).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(MyFragment.this.getActivity(), MyMoneyActivity.class);
                startActivity(intent);
            }
        });
        view.findViewById(R.id.tell).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                frameLayout.setVisibility(View.VISIBLE);

            }
        });
        view.findViewById(R.id.tv_cancel).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                frameLayout.setVisibility(View.GONE);
            }
        });

    }

    @Override
    protected void initData() {
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.drawable.myqq);
        CircleDrawable circleDrawable = new CircleDrawable(bitmap);
        imageViewqq.setImageDrawable(circleDrawable);

    }
}
